package day2.p2;

import java.util.Random;

public class TestCompartment {

	public static void main(String[] args) {
		Compartment[] comp = new Compartment[10];
		Random random = new Random();

		for (int i = 0; i < comp.length; i++) {
			int k = random.nextInt(5);
			// System.out.println(k);
			switch (k) {
			case 0:
				comp[i] = new FirstClass();
				break;
			case 1:
				comp[i] = new Ladies();
				break;
			case 2:
				comp[i] = new Luggage();
				break;
			default:
				comp[i] = new General();
				break;
			}
			comp[i].notice();
		}
	}
}
